home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / batch / tsbat36.zip / MVE.BAT < prev    next >
DOS Batch File  |  1992-01-25  |  1KB  |  59 lines

  1. @echo off
  2. echo.
  3. echo ┌───────────────────────────────────────────────────┐
  4. echo │ Move file(s) from one directory to another        │
  5. echo │ By Prof. Timo Salmi, ts@chyde.uwasa.fi, 25-Jan-92 │
  6. echo └───────────────────────────────────────────────────┘
  7. echo.
  8.  
  9. rem Give help if needed
  10. if "%2"=="" goto _help
  11.  
  12. rem Check that the source file(s) exists
  13. if exist %1 goto _label1
  14. echo File(s) %1 not found
  15. goto _out
  16.  
  17. rem Check that the target directory exists
  18. :_label1
  19. if exist %2nul goto _label2
  20. if exist %2\nul goto _label2
  21. echo The target directory %2 not found
  22. goto _out
  23.  
  24. rem Check that the target files do not already exits
  25. :_label2
  26. if exist %2%1 goto _exist
  27. if exist %2\%1 goto _exist
  28. goto _label3
  29.  
  30. rem Error message for existing target files
  31. :_exist
  32. echo File(s) %1 already exist(s) in %2
  33. goto _out
  34.  
  35. rem Copy the file(s)
  36. :_label3
  37. copy %1 %2 > nul
  38. echo File(s) %1 copied to %2
  39.  
  40. rem Check that the target files now exist
  41. if exist %2%1 goto _exist2
  42. if exist %2\%1 goto _exist2
  43. goto _out
  44.  
  45. rem Now remove the original files
  46. :_exist2
  47. del %1
  48. echo Original file(s) %1 deleted
  49. goto _out
  50.  
  51. :_help
  52. echo Usage: MVE FromFileWithNoPath ToDirectory
  53. if "%1"=="" goto _out
  54. echo.
  55. echo The ToDirectory parameter is missing
  56.  
  57. :_out
  58. echo on
  59.